package com.cqw.es.domain;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author: caoqingwen
 * @CreateTime: 2021-07-20 14:33
 * @Description: Es实体
 */
@Data
@NoArgsConstructor
@Document(indexName = "goods")
public class EsEntity {

    @Id
    private Long id;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String goodsName;

    @Field(type = FieldType.Text)
    private Integer count;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private BigDecimal price;

    @Field(type = FieldType.Date, analyzer = "ik_max_word", format = DateFormat.basic_date_time)
    private Date createTime;


}
